package com.rui.study.algorithm.L_深入理解JVM_方法调用;

public class StaticDispatch {

    static class Human {}
    static class Man extends Human {}
    static class Woman extends Human {}

    public void sayHello (Man man) {
        System.out.println("Man is Say Hello");
    }

    public void sayHello (Woman woman) {
        System.out.println("Woman is Say Hello");
    }

    public void sayHello (Human human) {
        System.out.println("Human is Say Hello");
    }

    public static void main(String[] args) {
        StaticDispatch sd = new StaticDispatch();
        Human man = new Man();
        Human woman = new Woman();
        sd.sayHello((Man) man);
        sd.sayHello((Woman) woman);
    }
}
